/*
 * AIBaseState.h
 *
 *  Created on: Sep 1, 2017
 *      Author: gaoyi
 */

#pragma once

#include "Character/newAI/AIDefine.h"
#include "Character/Creature.h"
#include "Character/newAI/AIData/AIData.h"
#include "Common/CharacterDefine.h"

class AIBaseState
{
public:
    virtual ~AIBaseState() {};

    /**
    *@brief  判断是否能转换到指定状态
    *@param  [in] pCreature 对象
    *@param  [in] eState 转换的指定状态
    *@return bool 能转换返回true，否则返回false
    */
    virtual bool CanChangeState(Creature* pCreature, AIData* pAiData, const AIStateEnum eState) = 0;

    /**
    *@brief  进入状态
    *@param  [in] pCreature 对象
    *@return bool 初始化成功返回true，否则返回false
    */
    virtual bool EnterState(Creature* pCreature, AIData* pAiData) = 0;

    /**
    *@brief  状态机处理接口
    *@param  [in] pCreature 对象
    *@return void
    */
    virtual void OnProcess(Creature* pCreature, AIData* pAiData) = 0;

    /**
    *@brief  结束状态
    *@param  [in] pCreature 对象
    *@return bool
    */
    virtual bool LeaveState(Creature* pCreature, AIData* pAiData) = 0;

    /**
    *@brief  当前状态下移动成功回调接口
    *@param  [in] pCreature 对象
    *@return void
    */
    virtual void MoveSuccess(Creature* pCreature, AIData* pAiData);

    /**
    *@brief  当前状态下移动失败回调接口
    *@param  [in] pCreature 对象
    *@return void
    */
    virtual void MoveFailed(Creature* pCreature, AIData* pAiData, int failedReason, Creature* pOtherCreature);
};



